/**
  @creator: cilang
  @qq: 1019383856
  @bili: https://space.bilibili.com/433915419
  @gitee: https://gitee.com/OpencvLZG
  @github: https://github.com/OpencvLZG
  @since: 2023/11/29
  @desc: //
**/

package service

import (
	"ginFlutterBolg/internal/dao"
	"ginFlutterBolg/internal/model"
)

type ArticleLikeSerivice struct {
}

// LikeArticle 关注文章
func (a *ArticleLikeSerivice) LikeArticle(articleLike *model.ArticleLike) error {
	articleLikeDao := new(dao.ArticleLikeDao)
	err := articleLikeDao.LikeArticle(articleLike)
	if err != nil {
		return err
	}
	return err
}

// GetArticleLikeList 获取关注文章列表
func (a *ArticleLikeSerivice) GetArticleLikeList(page int, userId int64) (*[]model.ArticleLike, error) {
	articleLikeDao := new(dao.ArticleLikeDao)
	articleLikeList, err := articleLikeDao.GetArticleLikeList(page, userId)
	if err != nil {
		return articleLikeList, err
	}
	return articleLikeList, err
}
